/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cmti.skeleton.service.impl;

import com.cmti.commons.entity.AuthenticationInfo;
import com.cmti.commons.util.RequestEndSystemInfo;
import com.cmti.commons.util.StringUtils;
import com.cmti.commons.web.AuthenticationFilter;
import com.cmti.skeleton.dao.mapper.SysLogMapper;
import com.cmti.skeleton.dto.SysLogDto;
import com.cmti.skeleton.entity.SysLog;
import com.cmti.skeleton.service.SysLogService;
import com.github.pagehelper.PageHelper;
import java.util.Enumeration;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author danny
 */
@Service
@Transactional(readOnly = true)
public class SysLogServiceImpl implements SysLogService {

    private final Log log = LogFactory.getLog(this.getClass());

    @Autowired
    SysLogMapper dao;
//    @Autowired(required = false)
//    HttpServletRequest request;

    @Override
    @Transactional
    public void add(SysLog sysLog) {
        dao.insertSelective(sysLog);
    }

    @Override
    public List<SysLog> getList(SysLog sysLog) {
        SysLogDto dto = (SysLogDto) sysLog;
        PageHelper.startPage(dto.getDgm().getPage(), dto.getDgm().getRows());
        return dao.selectListByDto(sysLog);
    }

}
